<template>
  <div>
    <div style="font-size:12px;color:red;line-height: 20px">
      共享池的客户定义：<br/>
      （1）达到流转时间，强制进入共享池<br/>
      （2）未到半年流转时间的客户（23.7月之前按照1年期流转，23.7之后按照半年期流转）<br/>
      （3）三个月未跟进，半年未成交
    </div>
    <!--数据列表-->
    <div class="table-container">
      <vxe-grid ref='resourceListXGrid' v-bind="gridOptions"  size="mini" :loading="listLoading">
        <template #pager>
          <div style="overflow: hidden">
            <div class="pagination-container">
              <el-pagination
                background
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                layout="total, sizes,prev, pager, next,jumper"
                :current-page.sync="listQuery.pageNum"
                :page-size="listQuery.pageSize"
                :page-sizes="[10,15,20,50,100,200]"
                :total="count">
              </el-pagination>
            </div>
          </div>
        </template>
        <template #form>
          <div>
            <!--搜索-->
            <el-form :inline="true" :model="listQuery" size="mini" label-width="120px">
              <el-form-item label="最新跟进时间：">
                <el-radio-group v-model="listQuery.cglTrackingTimeType">
                  <el-radio-button label="">不限</el-radio-button>
                  <el-radio-button label="today">今天</el-radio-button>
                  <el-radio-button label="sevenDays">7天</el-radio-button>
                  <el-radio-button label="sevenDaysMore">超7天</el-radio-button>
                  <el-radio-button label="fifteenDaysMore">超15天</el-radio-button>
                  <el-radio-button label="thirtyDaysMore">超30天</el-radio-button>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="最新成交时间：">
                <el-radio-group v-model="listQuery.cglOrderTimeType">
                  <el-radio-button label="">不限</el-radio-button>
                  <el-radio-button label="sevenDaysMore">超7天</el-radio-button>
                  <el-radio-button label="fifteenDaysMore">超15天</el-radio-button>
                  <el-radio-button label="thirtyDays">超30天</el-radio-button>
                  <el-radio-button label="thirtyDaysMore">超60天</el-radio-button>
                  <el-radio-button label="超90天">超90天</el-radio-button>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="客户名称：">
                <el-select
                  clearable
                  v-model="listQuery.keyword"
                  filterable
                  remote
                  reserve-keyword
                  placeholder="请输入关键词"
                  :remote-method="querySearch">
                  <el-option
                    v-for="item in querySearchList"
                    :key="item.customerId"
                    :label="item.customerName"
                    :value="item.customerName">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="产品线：">
                <el-select v-model="listQuery.goodsLineId" filterable clearable>
                  <el-option :label="item.cddValue" v-for="item in goodsLineList" :value="item.cddId" :key="item.cddId"></el-option>
                </el-select>
              </el-form-item>
                <el-form-item label="更新日期：">
                  <el-date-picker
                    v-model="listQuery.cglUpdateTime"
                    type="daterange"
                    format="yyyy 年 MM 月 dd 日"
                    value-format="yyyy-MM-dd"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期">
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="创建时间：">
                  <el-date-picker
                    v-model="listQuery.cglCreateTime"
                    type="daterange"
                    format="yyyy 年 MM 月 dd 日"
                    value-format="yyyy-MM-dd"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期">
                  </el-date-picker>
                </el-form-item>
              <el-form-item label="排序：">
                <el-select v-model="listQuery.orderBy"  placeholder="请选择" clearable>
                  <el-option key="1" label="最新跟进时间倒序" value="1"></el-option>
                  <el-option key="2" label="最新跟进时间升序" value="2"></el-option>
                  <el-option key="3" label="最新成交时间倒序" value="3"></el-option>
                  <el-option key="4" label="最新成交时间升序" value="4"></el-option>
                  <el-option key="5" label="成交量升序" value="5"></el-option>
                  <el-option key="6" label="成交量倒序" value="6"></el-option>
                  <el-option key="7" label="持有时间倒序" value="7"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="所在地区：" >
                <el-select v-model="areaId1" placeholder="请选择省" @change="changeAreaId1" style="width:120px" clearable>
                  <el-option v-for="item in  options"  :key="item.areaId" :label="item.areaName"  :value="item.areaId" ></el-option>
                </el-select>

                <el-select v-model="areaId2" placeholder="请选择市" @change="changeAreaId2" v-if="areaId1" style="width:120px" clearable>
                  <el-option v-for="item in  options[areaIndex1]['areaChildList']"  :key="item.areaId" :label="item.areaName"  :value="item.areaId"></el-option>
                </el-select>
                <el-select v-model="areaId2" placeholder="请选择市" @change="changeAreaId2" v-else style="width:120px" clearable></el-select>
                <el-select v-model="areaId3" placeholder="请选择区" v-if="areaId1 && areaId2" style="width:120px" clearable>
                  <el-option v-for="item in  options[areaIndex1]['areaChildList'][areaIndex2]['areaChildList']"  :key="item.areaId" :label="item.areaName"  :value="item.areaId"></el-option>
                </el-select>
                <el-select v-model="areaId3" placeholder="请选择区" v-else style="width:120px"></el-select>
              </el-form-item>
              <el-form-item label="负责人：">
                <el-select v-model="listQuery.chargeId"  placeholder="请选择" clearable filterable>
                  <el-option
                    v-for="item in userOptionList"
                    :key="item.userId"
                    :label="item.userName"
                    :value="item.userId">
                  </el-option>
                </el-select>
              </el-form-item>
                <el-form-item>
                    <el-button
                      @click="handleSearchList()"
                      type="primary">
                      查询
                    </el-button>
                </el-form-item>
            </el-form>
          </div>
        </template>
        <template #toolbar_buttons>
            <el-button type="primary" size="small" @click="showPop1">申请转入</el-button>
            <el-button type="primary" size="small" @click="batchDel" v-if="resourcesDel">删除</el-button>
            <el-button type="primary" size="small" @click="batchUpdate" v-if="moveGoodsLine">批量转移</el-button>
            <span style="padding-left:20px">合计产品线数：{{ goodsLineCount }}个</span>
        </template>
        <template #num1_default="{ row, rowIndex }">
          <div @click="toDetail(row)" type="primary"  style="font-size:12px;vertical-align: middle;cursor:pointer;text-align: center;color:#409EFF">
            <div>{{row.customerName}}</div>
            <div>{{row.kingNumber}}</div>
          </div>
        </template>
        <template #num2_default="{ row, rowIndex }">
          <span v-for="item in row.relationCustomers" style="padding-left:10px">{{item.customerName}}</span>
        </template>
      </vxe-grid>
    </div>

    <el-dialog :close-on-click-modal="false" title="申请转入" :visible.sync="dialogVisible" width="800px">
      <el-form :inline="true" :model="form" size="mini" label-width="100px" :rules="rules" ref="form">
        <el-table :data="form.list" border style="width: 100%;margin:20px 0">
          <el-table-column
            align="center"
            label="客户名称">
            <template slot-scope="scope">
              <div>{{scope.row.customerName}}</div>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            label="产品线"
            width="150">
            <template slot-scope="scope">
              <div>{{scope.row.goodsLineName}}</div>
            </template>
          </el-table-column>
          <el-table-column
            label="申请目标（吨）"
            width="120"
            align="center">
            <template slot-scope="scope">
              <el-form-item :prop="`list.${scope.$index}.targetNum`" :rules="rules.targetNum" >
                <el-input v-model="scope.row.targetNum"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
          <el-table-column  label="申请备注" width="200" align="center">
            <template slot-scope="scope">
              <el-form-item :rules="rules.applyRemark" :prop="`list.${scope.$index}.applyRemark`">
                <el-input v-model="scope.row.applyRemark"></el-input>
              </el-form-item>
            </template>
          </el-table-column>
        </el-table>
      </el-form>

      <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose">取 消</el-button>
          <el-button type="primary" @click="handleConfirm" :loading="btnLoading">确 定</el-button>
      </span>
    </el-dialog>

    <import-pop ref="importPop" @getList="handleSearchList"></import-pop>

    <el-dialog :close-on-click-modal="false" title="转移记录" :visible.sync="dialogVisible2" width="800px">
      <div style="overflow: hidden">
        <el-table ref="productTable"
                  :data="popList2"
                  style="width: 100%;font-size: 12px;"
                  v-loading="popLoading2"
                  border>
          <el-table-column label="转移人"  align="center" min-width="100">
            <template slot-scope="scope">{{scope.row.userName}}</template>
          </el-table-column>
          <el-table-column label="转移时间"  align="center" min-width="100">
            <template slot-scope="scope">{{scope.row.createdAt }}</template>
          </el-table-column>
          <el-table-column label="转移类型"  align="center" min-width="150">
            <template slot-scope="scope">{{scope.row.type == 0 ? '移出' : '移入'}}</template>
          </el-table-column>
          <el-table-column label="转移原因"  align="center" min-width="150" show-overflow-tooltip>
            <template slot-scope="scope">{{scope.row.reason}}</template>
          </el-table-column>
          <el-table-column label="转移备注"  align="center" min-width="150" show-overflow-tooltip>
            <template slot-scope="scope">{{scope.row.remark}}</template>
          </el-table-column>
        </el-table>
        <div class="pagination-container">
          <el-pagination
            background
            @size-change="handleSizeChange2"
            @current-change="handleCurrentChange2"
            layout="total, sizes,prev, pager, next,jumper"
            :page-size="listQuery2.pageSize"
            :page-sizes="[10,15,20]"
            :current-page.sync="listQuery2.pageNum"
            :total="total2">
          </el-pagination>
        </div>
      </div>

    </el-dialog>

    <el-dialog :close-on-click-modal="false" title="申请记录" :visible.sync="dialogVisible3" width="800px">
      <div style="overflow: hidden">
        <el-table ref="productTable"
                  :data="popList3"
                  style="width: 100%;font-size: 12px;"
                  v-loading="popLoading3"
                  border>
          <el-table-column label="申请人"  align="center" min-width="100">
            <template slot-scope="scope">{{scope.row.userName}}</template>
          </el-table-column>
          <el-table-column label="申请时间"  align="center" min-width="100">
            <template slot-scope="scope">{{scope.row.createdAt}}</template>
          </el-table-column>
          <el-table-column label="申请目标"  align="center" min-width="150">
            <template slot-scope="scope">{{scope.row.targetNum}}</template>
          </el-table-column>
          <el-table-column label="申请备注"  align="center" min-width="100" show-overflow-tooltip>
            <template slot-scope="scope">{{scope.row.applyRemark}}</template>
          </el-table-column>
          <el-table-column label="状态"  align="center" min-width="100">
            <template slot-scope="scope">{{scope.row.applyState | fifapplyState}}</template>
          </el-table-column>
        </el-table>
        <div class="pagination-container">
          <el-pagination
            background
            @size-change="handleSizeChange3"
            @current-change="handleCurrentChange3"
            layout="total, sizes,prev, pager, next,jumper"
            :page-size="listQuery3.pageSize"
            :page-sizes="[10,15,20]"
            :current-page.sync="listQuery3.pageNum"
            :total="total3">
          </el-pagination>
        </div>
      </div>

    </el-dialog>
  </div>
</template>
<script>
import {getOrderUsersList,getCustomerOption,getCustomerSetting,getAddressList} from '@/api/partner'
import {planGoodsListScheduled,} from '@/api/order'
import {customerNewApplyList,customerNewAddApply,customerNewLogList,customerAllGoodsLine,deleteGoodsLine} from "@/api/company";
import {formatDate} from '@/utils/date';
import importPop from './importPop';
import store from '@/store'
import { mapGetters } from 'vuex'

const defaultListQuery={
  tab:'resource',
  "chargeId" : '', //负责人ID
  "keyword" : "", //客户名称搜索
  "goodsLineId" : '', //客户产品线
  "cglCustomerPotential" : "", //潜在等级
  "cglMyChargeTime" : [], //负责日期范围
  "cglCreateTime" : [], //创建时间
  cglUpdateTime:[],
  "cglTrackingTimeType" : "", //跟进时间时间类型(今天-today,7天内-sevenDays,超7天-sevenDaysMore,超15天-fifteenDaysMore，超30天-thirtyDaysMore)
  "cglOrderTimeType" : "",  //最新成交时间类型(超7天-sevenDaysMore，超15天-fifteenDaysMore，超30天-thirtyDays,超60天-thirtyDaysMore，超90天-ninetyDaysMore)
  "orderBy" : "", //排序(最近跟进时间-trackingTimeDesc,最近成交时间-cglOrderTime,最新跟进成交时间-trackingOrderTime)
  "pageNum" : 1,
  "pageSize" : 10
};

const defaultListQuery1={
  "pageNum" : 1,      //第几页，默认1
  "pageSize" : 10     //每页几条，默认10条
};

const defaultForm={
  list:[]
};
export default {
  name: "index",
  data(){
    return {
      listQuery: JSON.parse(JSON.stringify(defaultListQuery)),
      count: 0,
      listLoading: false,
      roles:store.getters.roles ? store.getters.roles : [],
      userOptionList:[],
      gridOptions:{
        loading:this.listLoading,
        border: true,
        id: 'resourceList',
        align:'center',
        autoResize:true,
        size:'mini',
        rowConfig: {
          keyField: 'cglId',
          isHover: true
        },
        columnConfig: {
          resizable: true
        },
        customConfig: {
          storage: true,
        },
        checkboxConfig:{
          reserve:true
        },
        toolbarConfig: {
          zoom: true,
          custom: true,
          slots: {
            buttons: 'toolbar_buttons',
          }
        },
        spanMethod({ row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, visibleData }){
          let fields = ['orderSn','createTime','customerName','userRealName','timeSureDate','financeTime']
          if(!fields.includes(column['field'])){
            return { rowspan: 1, colspan: 1 }
          }else if(row['isMerge'] && (fields.includes(column['field']))){
            return { rowspan: row['rowNum'], colspan: 1 }
          }else {
            return { rowspan: 0, colspan: 0 }
          }
        },
        columns: [

          { type: 'checkbox',
            title: '',
            fixed:'left',
            width: 50,
          },
          {
            field: 'customerName',
            title: '客户名称',
            width: 150,
            slots: {
              // 使用插槽模板渲染
              default: 'num1_default',
            }
          },
          {
            field: 'goodsLineName',
            title: '产品线',
            width: 100,
          },
          {
            field: 'relationCustomers',
            title: '子客户',
            showOverflow:true,
            width: 150,
            slots: {
              // 使用插槽模板渲染
              default: 'num2_default',
            }
          },
          {
            field: 'cglUserName',
            title: '负责人',
            showOverflow:true,
            width: 100,
          },
          {
            field: 'cglTrackingTime',
            title: '最近跟进时间',
            width: 150,

          },
          {
            field: 'cglTrackingContent',
            title: '最近跟进内容',
            showOverflow:true,
            width: 150,
          },
          {
            field: 'cglOrderNum',
            title: '成交量',
            width: 100,
          },
          {
            field: 'cglOrderTime',
            title: '最近成交时间',
            width: 150,
          },
          {
            field: 'cglCommonTime',
            title: '转入时间',
            width: 150,
          },
          {
            field: 'cglCommonDays',
            title: '在池天数',
            width: 100,
          },
          {
            field: 'goodsSn',
            title: '使用材料',
            width: 150,
          },
          {
            field: '',
            title: '操作',
            width: 180,
            fixed:'right',
            slots: {
              // 使用 JSX 渲染
              default: ({ row }) => {
                return [
                  <el-button style="margin-right:10px;" type="text" size="small" onClick={ () => this.showPop2(row) }>转移记录</el-button>,
                  <el-button style="margin-right:10px;" type="text" size="small" onClick={ () => this.showPop3(row) }>申请记录</el-button>,
                ]
              }
            },
          },
        ],
        data:[],
      },
      list:[],


      dialogVisible:false,
      form:JSON.parse(JSON.stringify(defaultForm)),
      querySearchList:[],
      rules:{
        targetNum:[{required: true, message: '此项必填', trigger: 'blur'},],
        applyRemark:[{required: true, message: '此项必填', trigger: 'blur'},],
      },
      btnLoading:false,
      radio1:'',

      dialogVisible2:false,
      listQuery2: JSON.parse(JSON.stringify(defaultListQuery1)),
      popList2:[],
      popLoading2:false,
      total2:0,


      dialogVisible3:false,
      listQuery3: JSON.parse(JSON.stringify(defaultListQuery1)),
      popList3:[],
      popLoading3:false,
      total3:0,

      labels:[],
      goodsLineCount:'',
      goodsLineList:[],
      options:[],
      areaId1:'',
      areaId2:'',
      areaId3:'',
      areaIndex1:null,
      areaIndex2:null,
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'mobile',
      'userId'
    ]),
    departmentPL(){
      if(this.roles.indexOf("departmentPL") != -1){
        return true
      }else{
        return false
      }
    },
    resourcesDel(){
      if(this.roles.indexOf("resourcesDel") != -1){
        return true
      }else{
        return false
      }
    },
    moveGoodsLine(){
      if(this.roles.indexOf("moveGoodsLine") != -1){
        return true
      }else{
        return false
      }
    },
  },
  components : {
    importPop
  },
  created() {
      this.getAddressListData()
  },
  filters: {
    fifapplyState(val){
      if(val == 0){
          return '待审核'
      }else if(val == 1){
        return '审核成功'
      }else if(val == 2){
        return '审核失败'
      }else if(val == 3){
        return '取消'
      }
    }
  },
  methods:{
    //获取省市区列表
    getAddressListData(){
      getAddressList().then((res)=>{
        this.options = res;
      })
    },
    //切换省
    changeAreaId1(item){
      this.areaIndex1 = this.options.findIndex((el)=>{
        return item == el.areaId
      });
      this.areaIndex2 = null;
      this.areaId2 = '';
      this.areaId3 = '';
    },

    //切换市
    changeAreaId2(item){
      this.areaIndex2 = this.options[this.areaIndex1]['areaChildList'].findIndex((el)=>{
        return item == el.areaId
      });
      console.log("ads",this.areaIndex2)
      this.areaId3 = '';
    },


    //获取客户配置
    getCustomerSettingList(){
      getCustomerSetting().then((res)=>{
        res.forEach((el)=>{
          if(el.cdtCode == 'goods_line'){
            this.goodsLineList = el.data
          }
        });
      })
    },
    init(){
      this.handleSearchList();
      this.getCustomerSettingList();
      this.getUserOptionList()
    },

    toDetail(item){
      let routeData = this.$router.resolve({name:'customerGoodsLineInfo',query:{id:item.customerId}});
      window.open(routeData.href);
    },
    //显示转移记录
    showPop2(item){
      this.dialogVisible2 = true;
      this.listQuery2.pageNum = 1;
      this.listQuery2.cglId = item.cglId;
      this.getList2()
    },
    handleSizeChange2(val){
      this.listQuery2.pageNum = 1;
      this.listQuery2.pageSize = val;
       this.getList();
    },
    handleCurrentChange2(val){
      this.listQuery2.pageNum = val;
      this.getList();
    },

    //获取转移列表
    getList2() {
      this.popLoading2 = true;
      customerNewLogList(this.listQuery2).then(response => {
        this.popList2 = response.list;
        this.total2 = response.count;
        this.popLoading2 = false;
      }).catch(()=>{
        this.popLoading2 = false;
      });
    },

    //显示申请记录
    showPop3(item){
      this.dialogVisible3 = true;
      this.listQuery3.pageNum = 1;
      this.listQuery3.cglId = item.cglId;
      this.getList3()
    },
    handleSizeChange3(val){
      this.listQuery3.pageNum = 1;
      this.listQuery3.pageSize = val;
      this.getList3();
    },
    handleCurrentChange3(val){
      this.listQuery3.pageNum = val;
      this.getList3();
    },

    //获取申请列表
    getList3() {
      this.popLoading3 = true;
      customerNewApplyList(this.listQuery3).then(response => {
        this.popList3 = response.list;
        this.count = response.count;
        this.popLoading3 = false;
      }).catch(()=>{
        this.popLoading3 = false;
      });
    },


    //批量更新
    batchUpdate(){
      this.$refs.importPop.showImport('resourcelist','批量转移','/api/customerNew/download',)
    },

    //申请转入
    showPop1(){
        let list = this.$refs.resourceListXGrid.getCheckboxReserveRecords();
        let list2 = this.$refs.resourceListXGrid.getCheckboxRecords();
        let records = JSON.parse(JSON.stringify(list.concat(list2)));
        if(records.length == 0){
          this.$message({
            type: 'info',
            message: '请先选择记录！'
          });
          return false
        }
        this.dialogVisible = true;
        this.form = JSON.parse(JSON.stringify(defaultForm));
        records.forEach((el)=>{
          this.form.list.push({
            cglId:el.cglId,
            customerName:el.customerName,
            goodsLineName:el.goodsLineName,
            targetNum:'',
            applyRemark:'',
          })
        })
    },
    handleClose(){
      this.dialogVisible = false
    },
    handleConfirm(){
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.btnLoading = true;
          let pa = {};
          pa.list = []
          this.form.list.forEach((el)=>{
            pa.list.push({
              cglId:el.cglId,
              targetNum:el.targetNum,
              applyRemark:el.applyRemark,
            })
          })
          customerNewAddApply(pa).then(()=>{
            this.btnLoading = false;
            this.dialogVisible = false;
            this.getList()
          }).catch(()=>{
            this.btnLoading = false;
          })
        }
      })
    },

    //批量删除
    batchDel(){
      let list = this.$refs.resourceListXGrid.getCheckboxReserveRecords();
      let list2 = this.$refs.resourceListXGrid.getCheckboxRecords();
      let records = JSON.parse(JSON.stringify(list.concat(list2)));
      if(records.length == 0){
        this.$message({
          type: 'info',
          message: '请先选择记录！'
        });
        return false
      }
      let cglIds = []
      records.forEach((el)=>{
        cglIds.push(el.cglId)
      })
      this.delItem(cglIds.join(","))
    },

    delItem(srt){
      this.$confirm('确认删除？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteGoodsLine({cglIds:srt,target:1}).then(()=>{
          this.getList()
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
        })

      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消操作'
        });
      });
    },



    //客户名称输入匹配
    querySearch(queryString){
      if(queryString && queryString!= '') {
        getCustomerOption({keywords: queryString}).then((res) => {
          this.querySearchList = res;
        })
      }
    },

    //获取员工下拉选项
    getUserOptionList(){
      getOrderUsersList().then((res)=>{
        this.userOptionList = res;
      })
    },

    //选择员工名称
    handleSelectUserName(key,item){
      this.listQuery[key] = item.userId;
    },

    handleSizeChange(val){
      this.listQuery.pageNum = 1;
      this.listQuery.pageSize = val;
      this.getList();
    },
    handleCurrentChange(val){
      this.listQuery.pageNum = val;
      this.getList();
    },

    handleSearchList(){
      this.listQuery.pageNum = 1;
      this.getList();
    },
    //获取列表
    getList() {
      let listQuery =  JSON.parse(JSON.stringify(this.listQuery));
      listQuery.areaId1 = this.areaId1;
      listQuery.areaId2 = this.areaId2;
      listQuery.areaId3 = this.areaId3;
      customerAllGoodsLine(listQuery).then(response => {
        this.gridOptions.data = []
        response.list.forEach((el,i)=>{
          let newEL = JSON.parse(JSON.stringify(el));
          delete newEL.goodsLineList
          el.goodsLineList.forEach((ee,ii)=>{
            let newEE = JSON.parse(JSON.stringify(ee));
            if(ii == 0){
              console.log("ii",ii)
              newEE.isMerge = true;
              newEE.rowNum = el.goodsLineList.length;
            }else{
              newEE.isMerge = false;
              newEE.rowNum = 0;
            }
            let copy = Object.assign({},newEL,newEE);
            this.gridOptions.data.push(copy);
          })
        })
        this.count = response.count;
        this.goodsLineCount = response.goodsLineCount
        this.listLoading = false;
      }).catch(()=>{
        this.listLoading = false;
      });
    },

  },
}
</script>

<style  lang="scss">

.mergeCell .vxe-cell{padding:0;}
.mergeDiv{
  padding-left:10px;
  padding-right:10px;
  border-bottom:1px solid #e8eaec;
  min-height: 36px;
}

.mergeDiv:last-child{
  border-bottom: 0;
}
</style>
